import request from "@/utils/request";

export interface TrademarkItemType {
  id?: number;
  tmName: string;
  logoUrl: string;
}

export type TrademarkListType = TrademarkItemType[];

interface reqGetTmReturnType {
  records: TrademarkListType;
  total: number;
  size: number;
  current: number;
  searchCount: boolean;
  pages: number;
}

export const reqGetTrademarkInfo = (page: number, limit: number) => {
  return request.get<null, reqGetTmReturnType>(
    `/admin/product/baseTrademark/${page}/${limit}`
  );
};

export const reqAddTrademark = (tmInfo: TrademarkItemType) => {
  return request.post(`/admin/product/baseTrademark/save`, tmInfo);
};

export const reqUpdataTrademark = (tmInfo: TrademarkItemType) => {
  return request.put(`/admin/product/baseTrademark/update`, tmInfo);
};

export const reqDeleteTrademark = (id: number) => {
  return request.delete(`/admin/product/baseTrademark/remove/${id}`);
};
